package com.zp.self.module.level_5_设计模式.结构型模式.Ⅲ_装饰模式;

import lombok.Getter;
import lombok.Setter;

/**
 * @author ：by Zeng Peng
 * @date ：Created 2022/6/29 21:17
 * @description ：
 */
@Setter
@Getter
public class GarnishSideDish extends StapleFood{
    private StapleFood stapleFood;
    public GarnishSideDish(StapleFood stapleFood,float price, String desc) {
        super(price, desc);
        this.stapleFood=stapleFood;
    }

    @Override
    public float cost() {
        return stapleFood.cost()+super.cost();
    }

    @Override
    public String getDesc() {
        return stapleFood.getDesc()+"、"+super.getDesc();
    }
}
